package com.ikas.ai.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author ****
 */

@Getter
@AllArgsConstructor
public enum MeteTypeEnum {
    /**
     *
     */
    YX("遥信", "yx",0),
    YC("遥测", "yc",1);


    String cnName;
    String enName;
    Integer num;

    public static MeteTypeEnum convert(int code) {
        if (CategoryTypeEnum.YC.getCode() == code) {
            return MeteTypeEnum.YC;
        } else if (CategoryTypeEnum.YX.getCode() == code) {
            return MeteTypeEnum.YX;
        } else {
            throw new RuntimeException("参数错误");
        }
    }

    public static String getEnName(int code) {
        for (MeteTypeEnum value : MeteTypeEnum.values()) {
            if (value.getNum() == code) {
                return value.enName;
            }
        }
        return "";
    }
}
